<div style="width: 100%;padding:5px 5px 5px 5px;background-color:#afba9b;color:white;">
	<strong>Course Management</strong>
</div>
<ul>
<?php 
$preVenuId = -1;
for($i=0;$i<count($result);$i++){
	$c = $result[$i];
	if($i==0 || $preVenuId != $c->venue->venueid){
		if($i > 0){
			echo "</ul>\n</li>\n";
		}
		printf("<li>Venue: <a href=\"?%s&editVenue&venueid=%s\">%s</a>\n</li>\n<ul>\n",AdminItemEnum::COURSES,$c->venue->venueid,$c->venue->venuename);
	}
	printf("\t<li>Course: <a href=\"?%s&editCourse&courseid=%s\">%s</a></li>\n",AdminItemEnum::COURSES,$c->courseid,$c->coursename);
			
	$preVenuId = $c->venue->venueid;
}
?>
</ul>